package ace.module.upms.core.impl.manager;

import ace.cmp.data.spring.data.jdbc.querydsl.rsql.core.manager.DtoManager;
import ace.module.upms.api.model.dto.UpmsOrganizationAccountDto;
import ace.module.upms.core.impl.dao.entity.UpmsOrganizationAccount;
import java.util.AbstractMap.SimpleEntry;
import java.util.List;

/**
 * 组织与账户关系 spring data jdbc querydsl rsql manager.
 *
 * @author Caspar
 */
public interface UpmsOrganizationAccountManager extends DtoManager<UpmsOrganizationAccount, Long, UpmsOrganizationAccountDto> {

  List<UpmsOrganizationAccount> getByUpmsAppIdAndIamAccountIdIn(Long upmsAppId, List<Long> queryIamAccountIds);

  boolean noneMatch(List<UpmsOrganizationAccount> upmsOrganizationAccounts, Long upmsOrgId, Long iamAccountId);

  UpmsOrganizationAccount build(Long upmsAppId, Long upmsOrgId, Long iamAccountId);

  boolean anyMatch(List<UpmsOrganizationAccount> upmsOrganizationAccounts, List<SimpleEntry<Long, Long>> orgIdAndAccountIds);

  void insertNewAndDeleteByIdIn(List<UpmsOrganizationAccount> newUpmsOrganizationAccounts, List<Long> deleteUpmsOrganizationAccountIds);
}